<%@ page language="java" pageEncoding="utf-8" %>

<!DOCTYPE html>
<html>
<head>
	<%@include file="../common/base.jsp"%>
	<meta charset="utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache,must-revalidate">
	<meta http-equiv="expires" content="0">
	<title>取消订单</title>
	<link rel="stylesheet" type="text/css" href="${base}/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="${base}/css/global.css?version=${version}">
	<link rel="stylesheet" type="text/css" href="${base}/css/takecar.css?version=${version}">
	<style type="text/css">
		.layui-layer {
			border-radius: 0px !important;
		}
		body{
			position: absolute;
			top: 0;
			right: 0;
			left: 0;
			bottom: 0;
			min-height: 520px;
		}
		.l-footer-wpay{
			position: absolute;
			left: 0;
			right: 0;
			bottom: 15px;
		}
	</style>
</head>
<body>
<div class="container-fluid">
	<div class="divBox driver-info">
		<%@include file="driverHtml.jsp"%>
		<p class="tip">行程已取消</p>
	</div>
	<%@include file="startEnd.jsp"%>
	<div>
		<div class="paymoney" style="text-align: center;margin-top: 20px">
			<div class="m-totalFare">共<span id="totalFare"></span>元</div>
			<div class="m-totalFare" id="couponMoney" style="display: none;">券已抵扣<span style="color: #f99359;">3.4元</span></div>
			<div class="m-totalFare"><div class="m-totalFare m-fareinfo" >查看明细</div></div>
			<div class="m-totalFare"><p id="cancelReason"></p></div>
		</div>
	</div>

</div>
<div class="l-footer-wpay">
	<%@include file="footer.jsp"%>
</div>
</body>
<script type="text/javascript" src="${base}/js/jquery.min.js"></script>
<script type="text/javascript" src="${base}/plugin/layer-v3.0.3/layer.js"></script>
<script type="text/javascript" src="${base}/js/localStorageOpt.js?version=${version}"></script>
<%--<script type="text/javascript" src="${base}/plugin/crypto-js/crypto-js.min.js"></script>--%>
<%--<script type="text/javascript" src="${base}/plugin/jsencrypt/jsencrypt.min.js"></script>--%>
<script type="text/javascript" src="${base}/js/utils.js?version=${version}"></script>
<script type="text/javascript" charset="UTF-8" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function ($) {

		var $document = $(document);
        var yun=new yueajax( "${openId}");

		var typeModule=''

        //初始化请求订单数据
        getOrderStatus(function (data) {
            //订单创建时间
            var cTime=new Date(data.data.createOn);
            var driver=data.data.driver;
            var cTobj=yun.time_count(cTime)
			$('.m-fareinfo').attr('data',yun.orderUuid)
            $('#faceimg').attr('src',driver.face || '/images/man.png');
            $('#driver_name').html(driver.name);
            $('#driver_score').append(driver.score)
            $('#driver_orderCount').html(driver.orderCount+'单')
            $('#driver_plateNum').html(driver.plateNum)
            $('#driver_carColor_brandName').html(driver.carColor+driver.brandName);
            $('#driver_mobile').attr('href','tel:'+driver.mobile);
            $('#clickCall').attr('href','tel:'+driver.mobile);
            $('#creadtime').html(cTobj.day+'  '+cTobj.hour+cTime.format('hh:mm'));
            $("#originDetailAddressText").html(data.data.originAddress);
            $("#destDetailAddressText").html(data.data.destAddress);
            $('#totalFare').html(data.data.actualFare);
            typeModule=data.data.typeModule
            if(!data.data.couponMoney){
                $("#couponMoney").hide()
			}else{
                $("#couponMoney").show();
                $("#couponMoney").find('span').html(data.data.couponMoney);
			}
            if(!!data.data.cancelReason){$('#cancelReason').html(data.data.cancelReason);}
        });
		//获取刚才派出的订单ID
		function getOrderStatus(callback) {
            yun.order_ajax(function(data){
                var d=data.data;
                changeUrl(data.data.subStatus,yun.orderUuid);
//                if (d.subStatus != 500) {
////                    changeUrl(data.data.subStatus,yun.orderUuid);
//                }
                //请求司机等待时间和等待费用
                if(typeof callback =="function"){
                    callback(data);
                }

            },function (data) {
                clearInterval(interval)
            })
		}
        //    费用详情
        $document.on('touchend', '.m-fareinfo', function () {
            layer.open({
                type: 2,
                title: false,
                closeBtn: false,
                shadeClose: false,
                //skin: 'layui-layer-rim', //加上边框
                area: ['100%', '100%'], //宽高,
                shadeClose: true,
                anim: 'up',
                content: '${base}/yue/fareInfo?orderUuid='+yun.orderUuid+'&typemodule='+typeModule,
                offset: 'lb',
				success:function(index){
					index.addClass('notradius')
				}
            });
        });
	});
</script>
</html>